/* input.h */

/**
 * @file
 * This module provides functions for reading compressed and uncompressed files.
 */

#ifndef INPUT_H
#define	INPUT_H

#define ANSI_COUNT 256


/**
 * Reads an uncompressed file and counts the occurence of each ANSI symbol.
 *
 * @param in_filename - The path of the input file.
 * @param occurence - The occurence of each ANSI symbol is saved in this array.
 *                    The integer value of the symbol is the index.
 * @return A string of the read file.
 */
extern char *read_uncompressed_file(char *in_filename, 
                                    int occurrence[ANSI_COUNT]);

/**
 * Reads a compressed and stores its code table in the given array.
 * 
 * @param in_filename - The path of the input file.
 * @param source - The compressed text is stored in this string.
 * @param code_table - The code table for decompressing the file which was
 *                     stored in the compressed file.
 * @return The number of symbols of the original uncompressed file.
 */
extern int read_compressed_file(char *in_filename, unsigned char **source,
                                char **code_table[]);


#endif	/* INPUT_H */

